package com.tiankun.eurekauserinfo.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created with IntelliJ IDEA
 * User: bear
 * Date: 2020/11/11
 * Description
 * Version: V1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "tb_user")
public class User implements Serializable {

    //user id
    @Id
    @Column(name = "user_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY) //设置id主键的策略为IDENTITY，作为自动增长策略
    private Integer id;
    //user name
    @Column(name = "user_name")
    private String name;
    //user 电话号码，登录名
    @Column(name = "user_phone")
    private String phone;
    //user 密码
    @Column(name = "user_password")
    private String password;
    //性别
    @Column(name = "user_sex")
    private Integer sex;
    //对时间格式进行处理
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    //生日
    @Column(name = "user_birthday")
    private Date birthday;
    //对时间格式进行处理
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    //创建时间（自动生成）
    @Column(name = "user_created")
    private Date created;
    //盐，对密码进行加密处理
    @Column(name = "user_salt")
    private String salt;
    //头像路径
    @Column(name = "user_img")
    private String img;
}
